package com.example.mybaseapp.util

import android.content.Context
import android.util.TypedValue
import androidx.annotation.Dimension
import androidx.annotation.Dimension.Companion.DP

class DisplayerUtil {
    companion object{
        fun dpToPx(context: Context, @Dimension(unit = DP) dp: Int): Float {
            val r = context.resources
            return TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP,
                dp.toFloat(),
                r.displayMetrics
            )
        }
    }

}